/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kidIcarus.decorator;

import com.kidIcarus.tools.ComboBoxUtil;
import com.kidIcarus.model.value.Value;
import com.kidIcarus.tools.ValueUtil;
import com.kidIcarus.weapon.WeaponCompleted;
import java.util.List;
import javax.swing.JComboBox;

/**
 *
 * @author squarezty
 */
public class ComboBox extends Decorator implements BoxFactory {

    ComboBoxUtil box;
    WeaponCompleted weapon;
    JComboBox jBox;
    JComboBox jBox1;
    JComboBox jBox2;
    List list;

    public ComboBox(WeaponCompleted weapon, JComboBox jBox, List<Value> list) {
        this.weapon = weapon;
        this.jBox = jBox;
        this.list = list;
    }

    public ComboBox(WeaponCompleted weapon, JComboBox jBox1, JComboBox jBox2, List list) {
        this.weapon = weapon;
        this.jBox1 = jBox1;
        this.jBox2 = jBox2;
        this.list = list;
    }

    public JComboBox getjBox() {
        return jBox;
    }
    
    public JComboBox getjBox1(){
        return this.jBox1;
    }
    
    public JComboBox getjBox2(){
        return this.jBox2;
    }

    public void setjBox(JComboBox jBox) {
        this.jBox = jBox;
    }

    public List getBoxValueList() {
        return list;
    }
    
    public double value() {
        double d1 = weapon.value();
        double d2;
        if(jBox!=null){
            d2 = (new ValueUtil()).value1(this);
        }else {
            d2 = (new ValueUtil()).value2(this);
        }        
        return d1 + d2;
    }

    public String getDescription() {
        return "";
    }
}
